/* 🌸 Ansible管理 - 二次元粉色主题 */
/* 基于CliCli风格的ACG主题设计 */

/* ==================== 页面容器 ==================== */
.ansible-inventories,
.ansible-credentials,
.ansible-playbooks,
.ansible-adhoc,
.ansible-jobs {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ==================== 页面头部 ==================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 24px 28px;
  background: linear-gradient(135deg, #fef5f8 0%, #fff0f6 100%);
  border-radius: 20px;
  border: 2px solid transparent;
  background-image: 
    linear-gradient(#fff, #fff),
    linear-gradient(135deg, #ff6b9d, #c471ed);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 4px 20px rgba(255, 107, 157, 0.15);
  position: relative;
}

.page-header::after {
  content: '✨';
  position: absolute;
  top: 20px;
  right: 120px;
  font-size: 20px;
  opacity: 0.3;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(180deg); }
}

.page-header h2,
.page-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #ff6b9d, #c471ed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-subtitle,
.subtitle {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin: 8px 0 0 0;
}

/* ==================== 空状态 ==================== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  background: var(--color-bg-secondary);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.3;
}

.empty-state p {
  color: var(--color-text-secondary);
  margin: 10px 0;
  font-size: 16px;
}

.empty-hint {
  font-size: 14px;
  color: var(--color-text-secondary);
  opacity: 0.7;
}

/* ==================== 卡片网格 ==================== */
.inventory-grid,
.credentials-grid,
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

/* ==================== 卡片样式 ==================== */
.inventory-card,
.credential-card,
.job-card {
  background: var(--color-bg-secondary);
  border: 2px solid transparent;
  background-image: 
    linear-gradient(#fff, #fff),
    linear-gradient(135deg, rgba(255, 107, 157, 0.3), rgba(196, 113, 237, 0.3));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 12px rgba(255, 107, 157, 0.1);
}

.inventory-card:hover,
.credential-card:hover,
.job-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(196, 113, 237, 0.2);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: linear-gradient(135deg, #fef5f8 0%, #fff0f6 100%);
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, #ff6b9d, #c471ed, #12cad6) 1;
}

.card-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, #ff6b9d, #c471ed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.card-body {
  padding: 20px;
}

.description {
  color: var(--color-text-secondary);
  margin-bottom: 15px;
  font-size: 14px;
  line-height: 1.6;
}

/* ==================== 信息行 ==================== */
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  align-items: center;
}

.info-row:last-child {
  border-bottom: none;
}

.info-row .label {
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.info-row .value {
  color: var(--color-text-primary);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-row .value.small {
  font-size: 11px;
  word-break: break-all;
}

/* ==================== 状态徽章 ==================== */
.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.status-badge.active {
  background: linear-gradient(135deg, rgba(81, 207, 102, 0.2), rgba(81, 207, 102, 0.1));
  color: var(--color-accent-success);
  border: 2px solid var(--color-accent-success);
}

.status-badge.inactive {
  background: linear-gradient(135deg, rgba(108, 117, 137, 0.2), rgba(108, 117, 137, 0.1));
  color: var(--color-text-secondary);
  border: 2px solid var(--color-text-secondary);
}

.status-badge.default {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
  color: #FFD700;
  border: 2px solid #FFD700;
}

/* ==================== 按钮样式 ==================== */
.btn {
  padding: 10px 24px;
  border-radius: 25px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '✨';
  position: absolute;
  top: 50%;
  left: -25px;
  transform: translateY(-50%);
  opacity: 0;
  transition: all 0.3s ease;
  font-size: 12px;
}

.btn:hover::before {
  left: 10px;
  opacity: 1;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, #ff6b9d, #c471ed);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #c471ed, #ff6b9d);
  box-shadow: 0 8px 25px rgba(196, 113, 237, 0.4);
  transform: translateY(-3px) scale(1.02);
}

.btn-success {
  background: linear-gradient(135deg, var(--color-accent-success), #4caf50);
  color: white;
  box-shadow: 0 4px 15px rgba(81, 207, 102, 0.3);
}

.btn-success:hover {
  box-shadow: 0 8px 25px rgba(81, 207, 102, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #ff6b6b, #ff8787);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-danger:hover {
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 13px;
}

.btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* ==================== 模态框 ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 107, 157, 0.15);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: #ffffff;
  border-radius: 24px;
  border: 3px solid transparent;
  background-image: 
    linear-gradient(#fff, #fff),
    linear-gradient(135deg, #ff6b9d, #c471ed);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(255, 107, 157, 0.25);
  animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  background: linear-gradient(135deg, #fef5f8 0%, #fff0f6 100%);
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, #ff6b9d, #c471ed, #12cad6) 1;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #ff6b9d, #c471ed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-close {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255, 107, 157, 0.2);
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.1), rgba(196, 113, 237, 0.1));
  color: #ff6b9d;
  font-size: 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  background: linear-gradient(135deg, #ff6b9d, #c471ed);
  color: white;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
}

.modal-body {
  flex: 1;
  overflow: auto;
  padding: 28px 32px;
  background: #ffffff;
}

/* ==================== 表单样式 ==================== */
.form-group {
  margin-bottom: 20px;
}

.form-group label,
.form-label {
  display: block;
  margin-bottom: 10px;
  color: #ff6b9d;
  font-weight: 600;
  font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select,
.form-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--color-bg-secondary);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  color: var(--color-text-primary);
  font-size: 14px;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-accent-pink);
  box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
  background: var(--color-bg-tertiary);
}

.required {
  color: #ff6b6b;
  margin-right: 4px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

/* ==================== 端口输入 ==================== */
.port-input {
  display: flex;
  align-items: center;
  gap: 10px;
}

.port-input input {
  flex: 1;
  text-align: center;
}

.port-btn {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255, 107, 157, 0.3);
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.1), rgba(196, 113, 237, 0.1));
  color: #ff6b9d;
  border-radius: 12px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.port-btn:hover {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.2), rgba(196, 113, 237, 0.2));
  border-color: #ff6b9d;
  transform: scale(1.1);
}

/* ==================== 单选按钮组 ==================== */
.radio-group-horizontal {
  display: flex;
  gap: 20px;
}

.radio-item-horizontal {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 16px;
  background: var(--color-bg-primary);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.radio-item-horizontal:hover {
  border-color: var(--color-accent-pink);
  background: var(--color-bg-tertiary);
}

.radio-item-horizontal input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent-pink);
}

.radio-item-horizontal span {
  color: var(--color-text-primary);
  font-size: 14px;
  font-weight: 600;
}

/* ==================== 复选框组 ==================== */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 10px 16px;
  background: var(--color-bg-primary);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.checkbox-item:hover {
  border-color: var(--color-accent-pink);
  background: var(--color-bg-tertiary);
}

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent-pink);
}

.checkbox-item span {
  color: var(--color-text-primary);
  font-size: 14px;
  font-weight: 600;
}

/* ==================== 标签图标 ==================== */
.label-icon {
  margin-right: 6px;
  font-size: 16px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .inventory-grid,
  .credentials-grid,
  .jobs-grid {
    grid-template-columns: 1fr;
  }
  
  .page-header {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }
  
  .page-header h2,
  .page-header h1 {
    font-size: 24px;
  }
}

/* ==================== 动画效果 ==================== */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}
